﻿@model MvcMovieCollection.Models.EditMovieBase

@{
    ViewBag.Title = "EditMovie";
}

<h1>Edit Movie</h1>

<h4>Use the form below to add a new movie to your Database.</h4>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    ViewBag.MovieID = this.Model.EditMovie.ID;
    <div>
        <fieldset>
            <legend>Edit a Movie</legend>
            @Html.HiddenFor(m => m.EditMovie.ID)
            @Html.ValidationSummary(true)
            <div class="editor-label">
                @Html.LabelFor(m => m.EditMovie.Title)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.EditMovie.Title)
                @Html.ValidationMessageFor(m => m.EditMovie.Title)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.EditMovie.Description)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.EditMovie.Description, new { cols = "30", rows = "10" })
                @Html.ValidationMessageFor(m => m.EditMovie.Description)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.EditMovie.ReleaseDate)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.EditMovie.ReleaseDate)
                @Html.ValidationMessageFor(m => m.EditMovie.ReleaseDate)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.EditMovie.Genre)
            </div>

            <div class="editor-field">
                @Html.DropDownListFor(m => m.Genre.ID, new SelectList(ViewBag.ModelListGenres, "ID", "Name"))                
            </div>

            <p>
                <input type="submit", value="Save Changes" />
            </p>

        </fieldset>
    </div>
}
